<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>关联现场</title> 
    <link href="css/base.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="jquery-easyui-1.5.3/themes/bootstrap/easyui.css">
    <link href="jquery-easyui-1.5.3/themes/icon.css" rel="stylesheet">
    <link href="css/basic_info.css" rel="stylesheet">
    <link rel="stylesheet" href="css/xk.css">
    <script type="text/javascript" src="font_jjkmvgsdpk/iconfont.js"></script>
    <link rel="stylesheet" href="font_jjkmvgsdpk/iconfont.css">
    <link href="css/process.css" rel="stylesheet">
</head> 
<body>
 <div class="container">
  <div class="content">
    <div class="easyui-panel" id="query-data" style="padding:1px;width: 100%;">
      <table id="dataGrid" ></table>
    </div>
  </div>  
 </div>
<div id="add_glxc" class="easyui-dialog" closed="true">
 <table class="xk_table">
   <tr>
     <td class="xk_dialog_label">
      <button class="easyui-linkbutton" id="sswp_add_btn" type="button" iconCls="icon-search">勘验号</button>   
     </td>
     <td class=""><input type="text" class="xk_dialog_input"></td>  
   </tr>  
 </table> 
</div>     
</body>
<script type="text/javascript" src="jquery-easyui-1.5.3/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.5.3/jquery.easyui.min.js"></script>
 <script type="text/javascript">
      var datagrid = $("#dataGrid").datagrid({
      title : "勘验号：K5000000000002019030009的关联现场列表",
      nowrap : false,
      border : false,
      locale : "zh_CN",
      width:'100%',
      iconCls : 'icon-save',
      striped : true,
      collapsible : true,
      //url : "${ctx}/sysLog/querySysLogList",
      data:[{'xuhao':'00001','kyh':'K5000000000002019030019','fasj':'2019-04-20','fadd':'长沙市岳麓区','ajlb':'长沙市岳麓区','xgxx':'长沙市岳麓区西中心'},
      {'xuhao':'00001','kyh':'K5000000000002019030019','fasj':'2019-04-20','fadd':'长沙市岳麓区','ajlb':'长沙市岳麓区','xgxx':'长沙市岳麓区西中心'},
      {'xuhao':'00001','kyh':'K5000000000002019030019','fasj':'2019-04-20','fadd':'长沙市岳麓区','ajlb':'长沙市岳麓区','xgxx':'长沙市岳麓区西中心'},
      {'xuhao':'00001','kyh':'K5000000000002019030019','fasj':'2019-04-20','fadd':'长沙市岳麓区','ajlb':'长沙市岳麓区','xgxx':'长沙市岳麓区西中心'},
      {'xuhao':'00001','kyh':'K5000000000002019030019','fasj':'2019-04-20','fadd':'长沙市岳麓区','ajlb':'长沙市岳麓区','xgxx':'长沙市岳麓区西中心'},],
      pagination : true,//表示在datagrid设置分页              
      rownumbers : true,
      //singleSelect : true,
      //
      //        警综关联 
      columns : [ [ 
      { field : 'xuhao',
        title : '序号',
        width : '8%',
        align : 'center' 
      }, {
        field : 'kyh',
        title : '勘验号',
        width : '20%',
        align : 'center'
      }, {
        field : 'fasj',
        title : '发案时间',
        width : '10%',
        align : 'center'
      }, {
        field : 'fadd',
        title : '发案地点',
        width : '20%',
        align : 'center'
      },{
        field : 'ajlb',
        title : '案件类别',
        width : '20%',
        align : 'center'
      } , {
        field : 'xgxx',
        title : '相关信息',
        width : '20%',
        align : 'center'
      }] ],
          toolbar:[          //工具条  
                {text:"新增关联现场",iconCls:"icon-add",handler:function(){//回调函数  
                   $("#add_glxc").dialog({
                     title:"请输入关联现场的勘验号",
                     width:"450px",
                     height:"200px",
                     closed: false,
                       buttons:[
                      {
                      text:"提交",
                      iconCls:"icon-redo",
                      handler:function(){
                       $("#add_glxc").dialog("close");
                      }
                      },{
                      text:"取消",
                      iconCls:"icon-save",
                      handler:function(){
                       $("#add_glxc").dialog("close");
                      }
                      }
                      ],
                   });
                     $('#add_glxc').dialog('open'); //打开添加对话框
                     $('#add_glxc').window('center');//使Dialog居中显示
                }},
                                {text:"删除关联现场",iconCls:"icon-remove",handler:function(){  
                    var rows=datagrid.datagrid('getSelections');  
                          var ids = [];
                        for (var i = 0; i < rows.length; i++) {
                        ids.push(rows[i].id);
                        }
                        if(rows.length<=0){  
                            $.messager.alert('提示','请选择要删除的行','error');  
                        } else{  
                          var idArray =  new Array();
                          for (var i = 0; i < rows.length; i++) {
                            idArray.push(rows[i].id);
                          }
                        var ids= idArray.join(",");//转成字符串
                        $.messager.confirm('提示','下级节点将一起删除，您确定要删除吗',function(t){  
                            if(t){  
                                $.ajax({  
                                  type : "post", 
                                    url : "${ctx}/sysDict/deleteSysDict",  
                                    data : {"ids":ids},  
                                    dataType : "json",  
                                    success : function(r) {  
                                        if (r.success) {  
                                            datagrid.datagrid('acceptChanges');  
                                            $.messager.show({  
                                                msg : r.msg,  
                                                title : "成功"  
                                            });  
                                            editRow = undefined;  
                                            datagrid.datagrid('reload');  
                                        } else {  
                                            datagrid.datagrid('beginEdit', editRow);  
                                            $.messager.alert("错误", r.msg, 'error');  
                                        }  
                                        datagrid.datagrid('unselectAll');  
                                    }  
                                });  
                              
                            }  
                        }); 
                    }  
                }} 
                ], 
                //height : $("#query-data").height() - 5,
    });

    //分页处理
    $("#dataGrid").datagrid("getPager").pagination({
      pageSize : 10,
      pageNumber : 1,
      pageList : [ 10, 20, 30, 40, 50 ],
      beforePageText : '第',//页数文本框前显示的汉字   
      afterPageText : '页    共 {pages} 页',
      displayMsg : '当前显示 {from} - {to} 条记录  共 {total} 条记录',
    });  
 </script>
</html>